Message types
messageType | Description of message |
---|---|
ACCESS_TOKEN | Access token for retrieval of final measurement results via HTTP endpoint |
MEASUREMENT_MEAN_DATA | Measurement mean data for current session |
MEASUREMENT_STATUS | Current status of measurement engine |
SENDING_RATE_WARNING | Notification about slowing of images sending from frontend |
MEASUREMENT_PROGRESS | Current progress of the measurement |
MEASUREMENT_SIGNAL | PPG signal calculated by the measurement engine |
MOVING_WARNING | Notification of user moving his head too much |
BLOOD_PRESSURE | Blood pressure values calculated for current session |
UNSTABLE_CONDITIONS_WARNING | Notification of unstable conditions |
INTERFERENCE_WARNING | Notification of interference which persists for long time |
SIGNAL_QUALITY | Current signal quality |
HRV_METRICS | Current values of HRV metrics |
1. SENDING_RATE_WARNING.
This message contains current notification message about slowing of image sending either because of device fps leak or due to internet connection.
When frontend receives this message, they can notify through user interface about the problem with image sending slowing. As far as we handle such an event of slowing for each incoming image the frontend side can display wrapped notification for user for some fixed time (2-3 sec) and after this time passed the notification should fade away.
Example:
{
"messageType": "SENDING_RATE_WARNING",
"data": {
"delayValue": "250",
"notificationMessage":"The image sending rate doesn't correspond to provided frame rate.
Please check your device state or internet connection"
}
}
Field | Type | Description |
---|---|---|
delayValue | long | Delay between image sending that doesn't match to fps specified |
notificationMessage | string | Detailed notification message for frontend |
2. MEASUREMENT_PROGRESS
This message contains current progress of the measurement.
The progress here means amount of images supplied to the backend divided by minimum amount of images required by RPPG algorithm to start calculating BPM values.
For example, if progress = 75%
, it means that only 75% of required images were supplied, so RPPG algorithm can't start calculating values yet.
If progress =
100%, it means that there were enough images supplied, so RPPG algorithm can already calculate the values.
If progress >
100%, it means that RPPG algorithm is in the recalibrating process.
Backend sends this message not after each frame, but with some interval.
This message is sent only if current tracker status in CALIBRATING
or RECALIBRATING
.
When frontend receives this message, it should notify the user about the current progress.
Example:
{
"messageType": "MEASUREMENT_PROGRESS",
"data": {
"progressPercent": 55,
}
}
Field | Type | Description |
---|---|---|
progressPercent | integer | Current progress (in percent) |
3. MEASUREMENT_SIGNAL
This message contains recent PPG signal data calculated by the measurement engine.
Data consists of last X values of PPG signal, where X <=
256.
If amount of data values <
256, it means that all signal data is sent.
If amount of data values =
256, it means that last 256 values of signal is sent.
The values of signal data are nonnegative integers within 0..127 interval (inclusive).
Backends sends this message to the frontend after receiving each image frame from the frontend.
When frontend receives this message, it should display this signal for the user (as a graph, for example).
Example:
{
"messageType": "MEASUREMENT_SIGNAL",
"data": {
"signal" : [
0,
34,
79,
127,
99
]
}
}
Field | Type | Description |
---|---|---|
signal | array of integers | Last signal values (each value is nonnegative integer within 0..127 interval (inclusive) |
4. MOVING_WARNING
This message is sent from the backend to the frontend when RPPG library determines that the user moves his head too much. The message is sent after each received image frame until the user stops moving.
When frontend receives this message, it should display notification to the user that user should stop moving.
Example:
{
"messageType": "MOVING_WARNING",
"data": {
}
}
5. UNSTABLE_CONDITIONS_WARNING
This message is sent by the backend when measurement status is NOISE_DURING_EXECUTION
for more than 5 seconds.
Recommended behavior for the frontend is to show the warning message (like "Detecting unstable conditions, attempting to re-adjust") to the user.
Example:
{
"messageType": "UNSTABLE_CONDITIONS_WARNING",
"data": {
}
}
6. INTERFERENCE_WARNING
This message is sent by backend when measurement status is NOISE_DURING_EXECUTION
for more than 15 seconds.
Recommended behavior for the frontend is to stop the session.
Example:
{
"messageType": "INTERFERENCE_WARNING",
"data": {
}
}